import type { DataTableProps } from "naive-ui";
import { MENU_TYPE_COLOR_MAP, MENU_TYPE_MAP } from '@/const/menu.list'
import { h } from 'vue'
import { GOODS_STATUS_COLOR_MAP, GOODS_STATUS_MAP } from '@/const/goods'

export const menuListColumns: DataTableProps["columns"] = [
	{
		title: '菜单名称',
		key: 'menuName',
		width: 180,
		ellipsis:{
			tooltip: true
		},
		render(item: any) {
			return h('div', {
				style: {
					color: `var(${MENU_TYPE_COLOR_MAP[item.menuType]})`,
				}
			}, [item.menuName])
		}
	},
	{
		title: '菜单类型',
		key: 'menuType',
		width: 100,
		render(item: any) {
			return h('div', {
				style: {
					color: `var(${MENU_TYPE_COLOR_MAP[item.menuType]})`,
				}
			}, [MENU_TYPE_MAP[item.menuType]])
		}
	},
	{
		title: '权限名',
		key: 'perms',
		width: 220,
	},
	{
		title: '页面地址',
		key: 'path',
		width: 300,
	}
]
